<%@ Import namespace="MIMS_WRS.Web" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="OrdersNotPlacedWithFactoryReport.aspx.vb" Inherits="MIMS_WRS.Web.OrdersNotPlacedWithFactoryReport"%>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
	<head>
		<title>
			<%= RequestContext.OfficeName %>
			P.O. and Container Schedule - Order Not Placed With Factory Report</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<link href="../../report.css" type="text/css" rel="stylesheet">
		<script language="javascript">
		<!--
		function printDocument() {
			window.document.getElementById('ActionTop').style.display = "none";
			window.document.getElementById('ActionBottom').style.display = "none";
			window.print();
			window.document.getElementById('ActionTop').style.display = "block";
			window.document.getElementById('ActionBottom').style.display = "block";
		}
		//-->
		</script>
		<style>
			.OrderReport SPAN.highlight { COLOR: black! important }
			.OrderReport SPAN.highlight2 { COLOR: red }
		</style>
	</head>
	<body>
		<form id="Form1" method="post" runat="server">
			<div id="ActionTop">
				<input type="button" value="Print" onclick="printDocument()"> &nbsp;&nbsp;&nbsp;<a href="../../StartPage.aspx">Front 
					page</a>&nbsp;|&nbsp;<a href="../../login.aspx?logout=1">Logout</a>
				<br><br>
				<asp:dropdownlist id="ddlConPoint" runat="server" onchange="conPointchanged('')"></asp:dropdownlist>&nbsp;<span id="divSupplier"></span>
				&nbsp;<asp:button id="btnSearch" runat="server" text="GO"></asp:button>
			</div>
			<div align="center" class="ReportTitle"><%= RequestContext.OfficeName %>
				P.O. and Container Schedule - Order Not Placed With Factory Report</div>
			<asp:repeater id="rptList" runat="server" enableviewstate="False">
				<headertemplate>
					<table class="OrderReport" cellpadding="0" cellspacing="1" border="1">
						<thead>
							<tr>
								<th>
									Req</th>
								<th>
									Sales Order</th>
								<th>
									Order Date</th>
								<th>
									Factory ETD</th>
								<th>
									Order Type</th>
								<th>Owner</th>
								<th>
									Supp</th>
								<th>
									O/No</th>
								<th>
									Primary</th>
								<th>
									Con</th>
								<th>
									PI/SC</th>
								<th>
									Acc No</th>
								<th>
									Customer</th>
								<th>
									Customer PO No</th>
								
							</tr>
						</thead>
						<tbody>
				</headertemplate>
				<itemtemplate>
					<tr>
						<td><%# Utilities.GetNormalText(DataBinder.Eval(Container.DataItem, "REQ")).PadLeft(4, "0"c)%>
						</td>
						<td><%# Utilities.GetNormalText(DataBinder.Eval(Container.DataItem, "SalesOrder"))%>
						</td>
						<td>
							<%# Utilities.GetDateText(DataBinder.Eval(Container.DataItem, "OrderDate")) %>
						</td>
						<td>
								<%# Utilities.GetDateText(DataBinder.Eval(Container.DataItem, "FactoryETD"))%>
							</td>
						<td>
							<%# Utilities.GetTypeMeaning(DataBinder.Eval(Container.DataItem, "PONo_Type")) %>
						</td>
						<td>
							<%# GetOwnerText(DataBinder.Eval(Container.DataItem, "OfficeID"))%>
						</td>
						<td>
							<%# Utilities.GetNormalText(DataBinder.Eval(Container.DataItem, "PONo_Supplier")).PadLeft(3, "0"c) %>
						</td>
						<td>
							<%# Utilities.GetNormalText(DataBinder.Eval(Container.DataItem, "PONo_Number")).PadLeft(3, "0"c) %>
						</td>
						<td>
							<%# Utilities.GetPrimaryMeaning(DataBinder.Eval(Container.DataItem, "IsPrimary")) %>
						</td>
						<td>
							<%# Utilities.GetNormalText(DataBinder.Eval(Container.DataItem, "PONo_Consolidation")) %>
						</td>
						<td>
							<%# Utilities.GetNormalText(DataBinder.Eval(Container.DataItem, "PI")) %>
						</td>
						<td>
							<%# Utilities.GetNormalText(DataBinder.Eval(Container.DataItem, "AccNo")) %>
						</td>
						<td>
							<%# Utilities.GetNormalText(DataBinder.Eval(Container.DataItem, "CustomerOrLocation")) %>
						</td>
						<td>
							<%# Utilities.GetNormalText(DataBinder.Eval(Container.DataItem, "CustPONo")) %>
						</td>
						
					</tr>
				</itemtemplate>
				<footertemplate>
					</tbody> </table>
				</footertemplate>
			</asp:repeater>
			<div id="ActionBottom">
				<br>
				<input type="button" value="Print" onclick="printDocument()">
			</div>
			<input type="hidden" id="hidSupplierCode" runat="server" name="hidSupplierCode">
			<script language="javascript">
		var divSupplier = document.getElementById('divSupplier');
		var ddlConPoint = document.getElementById('<%= ddlConPoint.ClientID %>');
		function supplierChanged(obj) {
			var hidSupplier = window.document.getElementById('<%= hidSupplierCode.ClientID %>');
			hidSupplier.value = obj.options[obj.selectedIndex].value;
		}
		
		function callback(res) {
			
			if (res.value) {
				divSupplier.innerHTML = res.value;			
			}
			else
				divSupplier.innerHTML = "";
		}
		
		function conPointchanged(selectedSupplier) {
			divSupplier.innerHTML = "<i>loading supplier...</i>";
			var hidSupplier = window.document.getElementById('<%= hidSupplierCode.ClientID %>');
			//hidSupplier.value = '';
			MIMS_WRS.Web.AjaxUtilMethod.GetSupplierHTMLForReportHeader(parseInt(ddlConPoint.options[ddlConPoint.selectedIndex].value), selectedSupplier, callback);	
		}
		
							
		conPointchanged('<%= RequestContext.SupplierCode %>');
		
		function searchClicked() {
			var ddlSupplier = window.document.getElementById('ddlSupplier');
			var hidSupplier = window.document.getElementById('<%= hidSupplierCode.ClientID %>');
									
			if (ddlSupplier != null) 
				hidSupplier.value = ddlSupplier.options[ddlSupplier.selectedIndex].value;
							
			/*	
			if (ddlSupplier != null && ddlSupplier.selectedIndex > 0) {	
				hidSupplier.value = ddlSupplier.options[ddlSupplier.selectedIndex].value;			
				return true;
			}			
			else {
				alert('Please select a supplier');
				return false;
			}
			*/
		}
			</script>
		</form>
	</body>
</html>
